home *** CD-ROM | disk | FTP | other *** search
- Path: unixg.ubc.ca!news
- From: jamesdf@unixg.ubc.ca (James Fairweather)
- Newsgroups: comp.lang.c++
- Subject: Re: solve equation non-recursively
- Date: Fri, 29 Mar 1996 05:56:03 GMT
- Organization: University of British Columbia
- Message-ID: <315b7adc.32382490@news.ucs.ubc.ca>
- References: <4jfjfv$q7b@nntp.crl.com>
- NNTP-Posting-Host: srtb0411a01.resnet.ubc.ca
- X-Newsreader: Forte Agent .99d/32.182
-
- On Fri, 29 Mar 1996 02:43:01 GMT, bk077@freenet.hsc.colorado.edu (ted)
- wrote:
-
- >i am trying to write a program to solve a 1st order equation but it
- >example;
- > x1, x2, x3 = {23, 44, 55}
- > Z = 1000
- >
- >would look like: 23A+44B+55C = 1000,
- >i need to solve for A, B, and C.
-
- I think you must have made a mistake here. You have n-1 degrees of
- freedom when solving this linear equation. Just set the first n-1
- coefficients to 0 and solve for the nth one. Done. In your example,
- A = 0, B = 0, C = 1000/55 is a valid solution.
- ---
- James Fairweather
- 4th year Comp. Eng, UBC
- Vancouver, BC, Canada
- jamesdf@unixg.ubc.ca
- 604.228.2269
-